class Inner2
{
public:
	Inner2(int _i)
		:i(_i)
	{}
public:
	int i;
};
class Out2
{
public:
	//构造函数
	Out2(Inner2* _inner = nullptr)
		:inner(_inner)
	{}
	//拷贝构造
	Out2(const Out2& out) //深拷贝
	{
		inner = new Inner2(*(out.inner)); //调用拷贝构造
	}
	//移动构造
	Out2(Out2&& out) noexcept
	{
		inner = out.inner;
		out.inner = nullptr; //进行移动构造时将out中的inner资源置空，防止析构时重复delete资源
	}
	~Out2()
	{
		std::cout << "~Out()" << std::endl;
		if (inner) {
			delete inner;
		}
	}
public:
	Inner2* inner;
};